﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace proRFID_DiemDanh.Lop
{
    public partial class ChuyenLop : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (string.IsNullOrEmpty(Request["ID"]))
                    Response.Redirect("/Lop/Lop.aspx");
                txt_tenlop.Text = Convert.ToString(Request["tenlop"]);
                lopcbo(Convert.ToInt32(Request["ID"]));
            }
        }
        void lopcbo(int malop)
        {
            ddl_denlop.DataSource = mdLop.DSlop_chuyencbo(malop); ;
            ddl_denlop.DataValueField = "MALOP";
            ddl_denlop.DataTextField = "TENLOP";
            ddl_denlop.DataBind();
        }

        protected void cmd_Luu_Click(object sender, ImageClickEventArgs e)
        {
            mdLop.DSlop_chuyen(Convert.ToString(Request["MASV"]),Convert.ToInt32(ddl_denlop.SelectedValue));
            Response.Redirect("/Lop/DSSinhVien.aspx?ID=" + ddl_denlop.SelectedValue + "&tenlop=" + ddl_denlop.SelectedItem);
        }

        protected void cmdHuy_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("/Lop/DSSinhVien.aspx?ID=" + Request["ID"] + "&tenlop=" + Request["tenlop"]);
        }

    }
}